<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>Tuxxedo Engine API Documentation</title>

		<link rel="stylesheet" href="./style.css" media="all" type="text/css" />
	</head>
	<body>

<h1>\Tuxxedo\Debug\Tracker</h1>
<div class="box">
	<div class="inner">
		<div class="left-content">
			<fieldset>
				<legend><strong>Meta information</strong></legend>
				<table cellspacing="4" cellpadding="0">
					<tr>
						<td>Availability:</td>
						<td class="value" style="width: 100%">
							Engine 1.2.0
						</td>
					</tr>
					<tr>
						<td>Type:</td>
						<td class="value" style="width: 100%">
							<a href="./classes.html">Class</a>
						</td>
					</tr>
					<tr>
	<td nowrap="nowrap">Namespace:</td>
	<td class="value" style="width: 100%" nowrap="nowrap">
		<a href="namespace-tuxxedo-debug-388970.html">\Tuxxedo\Debug</a>
	</td>
</tr><tr>
	<td nowrap="nowrap">Declared in:</td>
	<td class="value" style="width: 100%" nowrap="nowrap">
		library/Tuxxedo/Debug/Tracker.php
	</td>
</tr>
				</table>
			</fieldset>
		</div>
		<div class="content">
			<div class="infobox">
				Debug tracker class<br />This class can be used to log variables data for debugging
purposes, such as iterations which can be useful for writing
generators and other types of parsers to confirm states, but
it is not limited to such.<br /></code>
			</div>
			<br />
		</div>
		<div style="clear: left;"></div>
	</div>
</div>





<h2><span>Contents</span></h2>
<div class="box edge-title">
	<div class="inner">
		<div class="infobox">
			Table of contents
		</div>

		<h3>
	Properties
	<a name="properties"></a>
</h3>
<table style="width: 100%" cellspacing="2" cellpadding="0">
	<tr class="head">
		<td class="strong" nowrap="nowrap" style="width: 20%;">Property</td>
		<td class="strong">Description</td>
	</tr>
	<tr class="row">
	<td nowrap="nowrap"><a href="property-callback-hook-569696.html">$callback_hook</a></td>
	<td nowrap="nowrap" style="width: 100%">Callback hook</td>
</tr><tr class="row">
	<td nowrap="nowrap"><a href="property-log-data-235296.html">$log_data</a></td>
	<td nowrap="nowrap" style="width: 100%">Log data</td>
</tr>
</table><h3>
	Methods
	<a name="methods"></a>
</h3>
<table style="width: 100%" cellspacing="2" cellpadding="0">
	<tr class="head">
		<td class="strong" nowrap="nowrap" style="width: 20%;">Method</td>
		<td class="strong">Description</td>
	</tr>
	<tr class="row">
	<td nowrap="nowrap"><a href="method---construct-599778.html">__construct()</a></td>
	<td nowrap="nowrap" style="width: 100%">Constructor

Constructs a new tracker object</td>
</tr><tr class="row">
	<td nowrap="nowrap"><a href="method-end-955738.html">end()</a></td>
	<td nowrap="nowrap" style="width: 100%">Ends the tracker, ultimately calling the registered
callback which will have the stored log data pa...</td>
</tr><tr class="row">
	<td nowrap="nowrap"><a href="method-log-615527.html">log()</a></td>
	<td nowrap="nowrap" style="width: 100%">Log data for a specific state/iteration</td>
</tr>
</table>
	</div>
</div>

<h2><span>Examples</span></h2>
<div class="box edge-title">
	<div class="inner">
		<fieldset>
	<legend><strong>Example #1</strong></legend>
	<table cellspacing="4" cellpadding="0" style="width: 100%;">
		<tr> 
			<td colspan="2" class="value" style="width: 100%">
				<code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #007700">use&nbsp;</span><span style="color: #0000BB">Tuxxedo</span><span style="color: #007700">\</span><span style="color: #0000BB">Debug</span><span style="color: #007700">;<br /><br />class&nbsp;</span><span style="color: #0000BB">Test<br /></span><span style="color: #007700">{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;protected&nbsp;</span><span style="color: #0000BB">$iterations&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;protected&nbsp;</span><span style="color: #0000BB">$tracker</span><span style="color: #007700">;<br /><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;function&nbsp;</span><span style="color: #0000BB">__construct</span><span style="color: #007700">()<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">tracker&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">Debug</span><span style="color: #007700">\</span><span style="color: #0000BB">Tracker</span><span style="color: #007700">(function(</span><span style="color: #0000BB">$log_data</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">printf</span><span style="color: #007700">(</span><span style="color: #DD0000">'The&nbsp;log&nbsp;was&nbsp;called&nbsp;%d&nbsp;time(s)%s%s'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">sizeof</span><span style="color: #007700">(</span><span style="color: #0000BB">$log_data</span><span style="color: #007700">),&nbsp;</span><span style="color: #0000BB">PHP_EOL</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">PHP_EOL</span><span style="color: #007700">);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$log_data</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foreach(</span><span style="color: #0000BB">$log_data</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$log_data</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;function&nbsp;</span><span style="color: #0000BB">__destruct</span><span style="color: #007700">()<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">tracker</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">end</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;function&nbsp;</span><span style="color: #0000BB">iterator</span><span style="color: #007700">()<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">tracker</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">log</span><span style="color: #007700">([</span><span style="color: #DD0000">'iterations'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;++</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">iterations</span><span style="color: #007700">]);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />}<br /><br /></span><span style="color: #0000BB">$test&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">Test</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">$test</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">iterator</span><span style="color: #007700">();&nbsp;</span><span style="color: #FF8000">//&nbsp;Test::$iterations=1<br /></span><span style="color: #0000BB">$test</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">iterator</span><span style="color: #007700">();&nbsp;</span><span style="color: #FF8000">//&nbsp;Test::$iterations=2<br /><br /></span><span style="color: #007700">for(</span><span style="color: #0000BB">$x&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;&nbsp;</span><span style="color: #0000BB">$x&nbsp;</span><span style="color: #007700">&lt;&nbsp;</span><span style="color: #0000BB">40</span><span style="color: #007700">;&nbsp;++</span><span style="color: #0000BB">$x</span><span style="color: #007700">)<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$test</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">iterator</span><span style="color: #007700">();&nbsp;</span><span style="color: #FF8000">//&nbsp;Test::$iterations=N<br /></span><span style="color: #007700">}<br /><br />unset(</span><span style="color: #0000BB">$test</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//The&nbsp;log&nbsp;was&nbsp;called&nbsp;42&nbsp;time(s)<br />//<br />//...<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code>
			</td>
		</tr>
	</table>
</fieldset>
	</div>
</div>





<h2><span>See also</span></h2>
<div class="box edge-title">
	<div class="inner">
		<ul>
			
			<li><a href="./classes.html">List of classes</a></li>
			<li><a href="./index.html">Table of contents</a></li>
		</ul>
	</div>
</div>

		<p>
			<em>Generated by Tuxxedo Engine 1.2.0 "Beloved" Release Candidate 1 (experimental).</em>
		</p>
	</body>
</html>